import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { resolve } from "path";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue({
      template: {
        compilerOptions: {
          isCustomElement: (tag) => /^micro/.test(tag),
        },
      },
    }),
  ],
  server: {
    port: 5000,
    host: "0.0.0.0",
    fs: {
      strict: false,
    },
    open: false,
  },
  build: {
    outDir: "../dist/main",
  },
  css: {},

  base: `${
    process.env.NODE_ENV === "production"
      ? "http://192.168.60.31:5500/dist/main/"
      : ""
  }/`,
  resolve: {
    alias: [
      // {
      //   find: '@micro-zoe/micro-app',
      //   replacement: resolve(__dirname, '../../lib/index.esm.js')
      // },
    ],
  },
});
